home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / graphicgems4.lha / GemsIV / vec_mat / ray / Sphere.h < prev   
Encoding:
C/C++ Source or Header  |  1995-02-06  |  627 b   |  30 lines

  1. /************************************************************************
  2. *                                    *
  3. * CLASS: Sphere                                *
  4. * AUTHOR: Jean-Francois DOUE                        *
  5. * LAST MODIFICATION: 12 Oct 1993                    *
  6. *                                    *
  7. * This class implements a sphere.                    *
  8. *                                    *
  9. ************************************************************************/
  10.  
  11. #ifndef Sphere_h
  12. #define Sphere_h 1
  13. #include "Primitive.h"
  14.  
  15. class Sphere : public Primitive
  16. {
  17. protected:
  18.  double radius;
  19.  
  20. public:
  21.  
  22.  // virtual methods
  23.  double intersect(vec3& ray_org, vec3& ray_dir);
  24.  vec3 normalAt(vec3& p);
  25.  
  26.  // friends
  27.  friend istream& operator >> (istream& s, Sphere& a);
  28. };
  29.  
  30. #endif